package top.shiyiri.dao.impl;

import top.shiyiri.dao.BaseDao;
import top.shiyiri.dao.OrderItemDao;
import top.shiyiri.pojo.OrderItem;

/**
 * @author Aunean
 * @date 2022/2/10 11:27
 */
public class OrderItemDaoImpl extends BaseDao implements OrderItemDao {
    @Override
    public int saveOrderItem(OrderItem orderItem) {
        System.out.println("OrderItemDaoImpl 程序在【"+Thread.currentThread().getName()+"】中");

        String sql = "insert into t_order_item(`name`, `count`, `price`, `total_price`, `order_id`) values(?,?,?,?,?)";
        return update(sql, orderItem.getName(), orderItem.getCount(), orderItem.getPrice(), orderItem.getTotalPrice(), orderItem.getOrderId());
    }
}
